package com.yhg.feign;


import com.yhg.Product.Bean.Product;
import com.yhg.feign.fallback.ProductFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(value = "service-product",fallback = ProductFeignClientFallback.class)//消费端，注意与接收端的区别
public interface ProductFeignClient {

    //mvc注解的两套逻辑!!!
    //（1）标注在controller上：表示接受某种请求
    //（2）标注在feign上，表示发送某种请求
    @GetMapping("/product/{Id}")
    Product getProductById(@PathVariable("Id")  Long Id);
}
